package com.example.xinguanvue.controller;

import com.example.xinguanvue.bean.Menu;
import com.example.xinguanvue.service.MenuService;
import com.example.xinguanvue.service.impl.MenuServiceImpl;
import com.example.xinguanvue.vo.MenuVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//权限管理Controller
@RestController
@RequestMapping("/menu")
public class MenuController {
    private Logger logger = LoggerFactory.getLogger(UserController.class);

    private MenuService menuService;

    @Autowired
    public void setMenuService(MenuServiceImpl menuServiceImpl) {
        this.menuService = menuServiceImpl;
    }

    @RequestMapping("/listMenu")
    public List<MenuVo>  getListMenu(@RequestParam(defaultValue = "") String queryMenuParam){

        logger.info("请求到/menu/listMenu了---");
        return menuService.getListMenu(queryMenuParam);
    }

}
